package com.lfx.concurrent;

public class ReaderThread extends Thread{

    private final Data data;

    public ReaderThread(Data data) {
        this.data = data;
    }

    @Override
    public void run() {
        while (true){
            try {
               char[] buffer=   data.read();
                System.out.println(Thread.currentThread().getName() + " 读取 了 " + String.valueOf(buffer));
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
